import request from "@/axios";
import {Pagination}from "@/types/pagination"
import { Role } from "@/types/role";
export const getRoleList = (pages:Pagination.Pagination,params?:Role.RoleSearchQuery) => {
    return request({
        method: "get",
        url: "/api/system/role",
        params:Object.assign(pages,params ? params : {})
    })
}
export const appendRole = (data: Role.Role) => {
    return request({
        method: "post",
        url: "/api/system/role",
        data,
    })
}
export const updateRole = <T>(data:Role.Role| T) => {
    return request({
        method: "put",
        url: "/api/system/role",
        data,
    })
}
export const removeRole = (id: string) => {
    return request({
        method: "delete",
        url: "/api/system/role/" + id,
    })
}
export const sortRole = (data:Role.Role[]) => {
    return request({
        method: "post",
        url: "/api/system/role",
        data,
    })
}